<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<link rel="stylesheet" href="css/style.css" type="text/css"/>
		<link rel="stylesheet" href="css/jquery-ui.css" type="text/css"/>
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui.min.js"></script>
		<script type="text/javascript" src="js/template.js"></script>
		<script type="text/javascript" src="js/tools.js"></script>
		<script type="text/javascript" src="js/client.js"></script>
		<title>iptables</title>
		<style media="screen">
		body {
			background-color: #DADADA;
		}
		</style>
	</head>

	<body>
		<div class="ui middle aligned center aligned grid">
			<div class="column">
				<div class="error ui message"></div>
				<div class="info green ui message"></div>
			</div>
		</div>
		<div class="content">
			<ul class="tabs mainmenu">
				<li>
					<a class="item" onclick="rules.showList('input', 'filter');">输入</a>
					<ul class="dropdown" style="display: none;">
						<li><a class="item" onclick="rules.showList('input', 'filter');">输出</a></li>
						<li><a class="item" onclick="rules.showList('input', 'mangle');">mangle</a></li>
					</ul>
				</li>
				<li>
					<a class="item" onclick="rules.showList('output', 'filter');">输出</a>
					<ul class="dropdown" style="display: none;">
						<li><a class="item" onclick="rules.showList('output', 'filter');">filter</a></li>
						<li><a class="item" onclick="rules.showList('output', 'nat');">nat</a></li>
						<li><a class="item" onclick="rules.showList('output', 'mangle');">mangle</a></li>
					</ul>
				</li>
				<li>
					<a class="item" onclick="rules.showList('forward', 'filter');">FORWARD</a>
					<ul class="dropdown" style="display: none;">
						<li><a class="item" onclick="rules.showList('forward', 'filter');">filter</a></li>
						<li><a class="item" onclick="rules.showList('forward', 'mangle');">mangle</a></li>
					</ul>
				</li>
				<li>
					<a class="item" onclick="rules.showList('prerouting', 'nat');">PREROUTING</a>
					<ul class="dropdown" style="display: none;">
						<li><a class="item" onclick="rules.showList('prerouting', 'nat');">filter</a></li>
						<li><a class="item" onclick="rules.showList('prerouting', 'mangle');">mangle</a></li>
					</ul>
				</li>
				<li>
					<a class="item" onclick="rules.showList('postrouting', 'nat');">POSTROUTING</a>
					<ul class="dropdown" style="display: none;">
						<li><a class="item" onclick="rules.showList('postrouting', 'nat');">filter</a></li>
						<li><a class="item" onclick="rules.showList('postrouting', 'mangle');">mangle</a></li>
					</ul>
				</li>
				<li>
					<a class="item" onclick="rules.addChain();">Custom ↓</a>
					<ul class="dropdown" style="display: none;" id="customchains">

					</ul>
				</li>
			</ul>

			<table id="main" class="main">

			</table>

			<div class="tools">
				<a class="button" href="/logout" id="logout" style="display: none;">注销 <img class="icon" src="/img/logout.png"/></a>
				<a class="button" onclick="tools.showLogs();" title="Show system logs">系统日志 <img class="icon" src="/img/logs.png"/></a>
				<a class="button" onclick="tools.load();" title="Load rules from file">加载 <img class="icon" src="/img/load.png"/></a>
				<a class="button" onclick="tools.save();" title="Save rules into file">保存 <img class="icon" src="/img/save.png"/></a>
				<a class="button" onclick="tools.settingsDlg();" title="Show settings dialog">设置 <img class="icon" src="/img/settings.png"/></a>
				<a class="button" onclick="rules.resetCounters();" title="Reset counters for current chain">重置 <img class="icon" src="/img/reset.png"/></a>
			</div>

			<div class="settings">
				<div id="user-select-category">
					<div class="item" id="page1" onclick="tools.selectPage(1);"><img class="item-icon" src="/img/settings.png"/> 全局</div>
					<div class="item" id="page2" onclick="tools.selectPage(2)"><img class="item-icon" src="/img/lan.png"/> 网络映射</div>
					<div class="item" id="page3" onclick="tools.selectPage(3)"><img class="item-icon" src="/img/portmap.png"/> 端口映射</div>
				</div>
				<div id="settings-page1" style="display: block;">
					<table width="100%">
						<tr><td colspan="2" class="splitter">路径</td></tr>
						<tr>
							<td>Save rule path</td><td><input class="param" type="text" id="savePath"/></td>
						</tr>
						<tr><td colspan="2" class="splitter">安全</td></tr>
						<tr>
							<td>用户名：</td><td><input class="param" type="text" id="user"/></td>
						</tr>
						<tr>
							<td>密码：</td><td><input class="param" type="password" id="pass" title="Leave this param empty to cancel the authorization"/></td>
						</tr>
					</table>
				</div>
				<div id="settings-page2" style="display: none;">
					<table width="100%" id="lans" class="main">
						<tr><td class="cmd">网络</td><td class="rule">Alias</td><td class="mon"></td></tr>
					</table>
					<div class="tools"><a class="button" onclick="tools.addLan();">添加 lan</a></div>
				</div>
				<div id="settings-page3" style="display: none;">
					<table width="100%" id="ports" class="main">
						<tr><td class="cmd">端口</td><td class="rule">Alias</td><td class="mon"></td></tr>
					</table>
					<div class="tools"><a class="button" onclick="tools.addPort();">添加端口</a></div>
				</div>
			</div>

			<div class="addchain">
				<form>
					<table class="main">
						<tr><td class="cmd">规则名:</td><td><input type="text" id="chainname"/></td></tr>
						<tr><td class="cmd">表选项:</td><td><select id="chaintable"><option value="filter">filter</option><option value="nat">nat</option><option value="mangle">mangle</option></select></td></tr>
					</table>
				</form>
			</div>
			<div class="dialog" id="makeRule">
				<table class="" id="ruleTable">
				</table>
			</div>
			<div class="dialog" id="syslog">
				<div id="logs">

				</div>
			</div>
		</div>

	</body>

</html>
